< previous page page_177 next page >

Page 177
EXERCISE
Call Your Own Procedure
1. Double-click the Save command button on the Employee Information form.
2. Add the following call to the procedure EmployeeDisplay:
Private Sub cmdSave_Click()
Call EmployeeDisplay
End Sub
analysis.gifIt is preferable to use the Call keyword when you call your own procedures. This makes the code more readable, and offsets your own procedures from built-in Visual Basic statements.

Sub Main( ) Procedure
You can start a Visual Basic application using two different methods. First, you can use a form to start your application. This means that the form is loaded first and then it displays itself. The second method is to use a startup procedure. The name of this procedure must be called Main(). Figure 9.2 shows you the Project Properties dialog box, which is where you set how you wish to start your project.
8160-0177a.gif
Figure 9.2
The Project Properties dialog box.

 
< previous page page_177 next page >

If you like this book, buy it!